package elephant.servers.webserver.core;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.handler.AbstractHandler;

import elephant.servers.webserver.WebServer;
/**
 * 
 * @author icecooly
 *
 */
public class DefaultHandler extends AbstractHandler {
	private boolean showContexts = true;
	public DefaultHandler() {
	}

	public boolean getShowContexts() {
		return showContexts;
	}

	public void setShowContexts(boolean show) {
		showContexts = show;
	}

	@Override
	public void handle(String target, 
			org.eclipse.jetty.server.Request baseRequest,
			HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		response.addHeader("Server",WebServer.SERVER_NAME);
		if (response.isCommitted() || baseRequest.isHandled()){
			return;
		}
	}
}
